* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #efeeee;
}

.container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    width: 700px;
    height: 600px;
}

.container .box {
    display: flex;
    justify-content: space-around;
    align-items: center;
    /* 让元素垂直排列 这里就是让包含图片的div和文字垂直排列 */
    flex-direction: column;
    width: 100px;
    height: 140px;
    margin: 20px;
    cursor: pointer;
}

.container .box .img{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
    border-radius: 20px;
    box-shadow: 18px 18px 30px rgba(0,0,0,0.2),-18px -18px 30px rgba(255, 255, 255, 1);
    /* ease-out：先快后慢 */
    transition: all .2s ease-out;
}

.container .box .img img {
    width: 60px;
    transition: all .2s ease-out;
}

.container .box p {
    color: slategray;
}

/* 关键在以下步骤 */
.container .box .img:hover {
    /* inset：内部阴影 */
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.2),
    0 0 0 rgba(255, 255, 255, .8),
    inset 18px 18px 30px rgba(0, 0, 0, 0.1),
    inset -18px -18px 30px rgba(255, 255, 255, 1);
}

.container .box .img:hover img {
    width: 58px;
}
